#include <stdio.h>
#include "../includes/myrbtree.h"

int main(int argc, char **argv) {
    printf("myrbtree test start\n");
    int size = 10;
    int arr[] = {7, 1, 3, 23, 634, 11, 99, 123, 2121, 1198};
    mynode *nodes[10];
    myrbtree *t = rbtree_create();
    for (int i = 0; i < size; i++)
    {
        printf("insert %d to rbtree\n", arr[i]);
        mynode *n = node_create(arr[i], NULL);
        rbtree_insert(t, n);
        nodes[i] = n;
    }
    travel_tree(t);
    rbtree_remove(t, nodes[0]);
    printf(" \n\nafter remove:\n");
    travel_tree(t);
    
    return 0;
}